Harden renderer lifecycle, frame flow, resize, backend selection and recovery (Statement 9) - #9
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
RendererLifecycleState,RendererFrameStats,RendererStatus, andRendererConfigValidation, and utility helpers likeis_explicit_backend_requestand string converters; exposed new query APIsstate(),status(),is_ready(), andcan_render().validate_renderer_config, deterministic engine-owned backend mapping (RendererBackend) with requested-vs-actual logging, capability logging, and guarded re-init/shutdown transitions.begin_frame()/end_frame()that detect misuse (double-begin, end-without-begin), apply deferred/deduplicatedrequest_resize()at frame boundary, and record lightweight per-frame timing stats.bgfx::resetwithout requiring an app restart.RendererConfig::min_frame_time_msapplied inend_frame()(no simulation scheduler added).try_recover()andRecovering/Failedstates that attempts in-place reset and logs outcomes, preparing the architecture for future full resource re-creation.request_resize()and to gate rendering onbegin_frame()success, and updated documentation and engine README to describe the lifecycle contract.render_renderer_lifecycle_tests) so CI can cover lifecycle regressions once dependencies are available.Testing
tests/render/renderer_lifecycle_tests.cppand registered theunit.renderer.lifecycleCTest target so lifecycle checks are included inrender_test_unit.cmake --preset linux-debugin this environment but configure failed due to unresolved third-party dependency roots for SDL3/bgfx, so the project could not be built or tests executed here.Codex Task